const
    fs = require('fs'),
    path = require('path'),
    express = require('express'),
    morgan = require('morgan');

const
    app = express();

let
    accessLogStream = fs.createWriteStream(path.join(__dirname, 'access.log'), {
        flags: 'a'
    });


app // 日志
    .use(morgan('combined', { stream: accessLogStream }))
    // 路由
    .get('/', function(req, res) {
        res.send('heelo word');
    })
    // 监听端口
    .listen(3000);